class UsersController < ApplicationController
	#before_filter :require_user, :only => [:show, :edit, :update]
	load_and_authorize_resource :through => :account

	#def index
	#	redirect_back_or_default account_url
	#end

	#def new
	#	@user = User.new
	#end

	#def create
	#	@user = User.new(params[:user])
	#	if @user.save
	#		flash[:notice] = "Account registered!"
	#		redirect_back_or_default account_url
	#	else
	#		render :action => :new
	#	end
	#end

	def show
		@user = current_user
	end

	def view
		@user = User.find(params[:id])
		@comment = Comment.new
	end

	def edit
		@user = current_user
	end

	def update
		@user = current_user # makes our views "cleaner" and more consistent
		logger.debug "kew"
		if @user.update_attributes(params[:user])
			flash[:notice] = "Account updated!"
			redirect_to account_url
		else
			redirect_to password_account_url
		end
	end

	def search
	end
end
